#ifndef RECTITEM_H
#define RECTITEM_H

#include <QGraphicsItem>

class RectItem : public QGraphicsItem {
public:
    RectItem();

    virtual QRectF boundingRect() const override;
    virtual void   paint(QPainter*                       painter,
                         const QStyleOptionGraphicsItem* option, QWidget* widget);

protected:
    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* event) override;
    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent* event) override;
    virtual void dropEvent(QGraphicsSceneDragDropEvent* event) override;

private:
    QColor color;
    bool   dragOver; // 标志是否有拖动进入
};

#endif // RECTITEM_H
